{% extends "repo/repo.html" %}
{% block subcontainer %}
<div class="pulls inner bubble">
  <div class="header">
    <h2 class="heading">合并请求</h2>
  </div>

  {% if pullRequests %}
  {% for pullRequest in pullRequests %}
  <section class="pull-item">
    <div class="widget">
      <span class="status {{pullRequest.status_label}}">{{pullRequest.status_view}}</span>
      <span class="branches">
        <a href="/{{pullRequest.desc_repo.username}}/{{pullRequest.desc_repo.name}}/tree/{{pullRequest.desc_refname}}/" class="from branch">{{pullRequest.desc_refname}}</a>
        <span class="arrow-right"><i class="icon-long-arrow-right"></i></span>
        <a href="/{{pullRequest.source_repo.username}}/{{pullRequest.source_repo.name}}/tree/{{pullRequest.source_refname}}/" class="to branch">{{pullRequest.source_refname}}</a>
      </span>
    </div>
    <div class="summary">
      <h3 class="heading">
        <a href="/{{user_name}}/{{repo_name}}/pull/{{pullRequest.id}}/">{{pullRequest.short_title}}</a>
        <span class="id">#{{pullRequest.id}}</span>
      </h3>
      <div class="desc unavailable">
        {% if pullRequest.short_desc %}
        <p>{{pullRequest.short_desc}}</p>
        {% else %}
        <p>没有介绍内容</p>
        {% endif %}
      </div>
      <div class="meta">
        <a href="/{{pullRequest.pull_user.username}}/">{{pullRequest.pull_user.username}}</a>
        <time class="unixtime" pubdate="pubdate">{{pullRequest.modify_time|date:"U"}}</time>
      </div>
    </div>
  </section>
  {% endfor %}
  {% else %}
  <p class="alert alert-error">没有合并请求。<a href="/{{ user_name }}/{{ repo_name }}/pull/new/" class="btn btn-success"><i class="octicon octicon-git-pull-request"></i>创建合并请求</a></p>
  {% endif %}
</div>
{% endblock %}
